//#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "head.h"

int main(int argc, char *argv[]) {
   	int a = 5, b = 7, c = 20;
	int x = 1, y = 2;
	c = c + - a * b - c % b++;
	#pragma message("I am msg!")
	//printf("fun is %d\n",fun(&x, &y));
	fun(&x,&y);
	printf("x=%d, y=%d",x,y);
	printf("result:%d\n",c);
	for(a=0;a<argc;a++)
	printf("%s\n",argv[a]);

	int ar[10];
	for(a=0;a<10;a++){
		ar[a] = rand() % 100 + 1;
		printf("%4d", ar[a]);
	}
	printf("\n");

	char d[] = "liming";
	char e = 2000;
	printf("d length is %d\n",sizeof(d));
	printf("e is %d\n",e);
	puts(d);
	long n = 10;
	printf("feibonaqi is %ld\n",fibonacci(n));

	char *p = "123y456a";
	printf("change is %d\n",atoi(p));

	f = max; // 函数指针f指向求最大值的函数max  
    int r = (*f)(1, 2);  
  
    printf("The max value is %d \n", r);  
	
    f = min; // 函数指针f指向求最小值的函数min  
    r = (*f)(1, 2);  
  
    printf("The min value is %d \n", r); 

	//指针函数
	int *p1 = NULL;  
    printf("The memeory address of p1 = 0x%x \n", p1);  
  
    p1 = f1(1, 2);  
  
    printf("The memeory address of p1 = 0x%x \n", p1);  
    printf("*p1 = %d \n", *p1); 
	
	char s1[10];
	puts(memset(s1, 'd', 9));
	
	openFile();
	
	readFile();
	
	writeFile();
	
	file_io();
	
	return 0;
}

